package com.fishbone.cloud.user.feign;

import com.fishbone.cloud.user.api.bo.UserBO;
import com.fishbone.cloud.user.api.feign.IUserClient;
import com.fishbone.core.api.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.Arrays;

/**
 * @author huyaxi
 */
@ApiIgnore
@RestController
public class UserFeignClient implements IUserClient {

    @Override
    @GetMapping(USER_AUTH)
    public ResponseEntity<UserBO> getUserAuth(String tenant, String account) {
        UserBO userBO = new UserBO();
        userBO.setId(1L);
        userBO.setAccount("admin");
        userBO.setPassword("{bcrypt}$2a$10$hhLitNZXOT3zV0yHbdmg0e4vmOrTI1lGSZs.4EGPtKSCu/VfBavS2");
        userBO.setAvatar(1L);
        userBO.setName("张三");
        userBO.setPhone("15328142176");
        userBO.setStatus(1);
        userBO.setTenantId(1L);
        userBO.setIsDeleted(false);
        userBO.setRoleAlias(Arrays.asList("ROLE_ADMIN","ROLE_USER"));
        userBO.setRoleIds(Arrays.asList(1L,2L));
        return ResponseEntity.data(userBO);
    }
}
